import json
import bson
from bson.codec_options import CodecOptions

data = {
    "name": "lilisi",
    "age": 18,
    "source":{
        "math": 66.6,
        "english": 88.8,
        "physics": 99.9,
    },
    "height": 180,
    "weight": 70,
}

# 1.bson 序列化
bson_data = bson.encode(data)
print(bson_data)

# 2.bson 反序列化
decode_bson_data = bson.decode(bson_data)
print(decode_bson_data)